Begin _NR_Child_wow

Short NoLore
Float Timer
Short Scared
Short Wow

If ( GetPCCrimeLevel >= 800 )
	Set Scared to 1
elseif ( GetPCCrimeLevel < 800 )
	Set Scared to 0
endif

If ( GetReputation Player >= 45 )
	Set Wow to 1
elseif ( GetReputation Player < 45 )
	Set Wow to 0
endif

If ( GetDistance Player <= 512 )
elseif ( GetDistance Player > 512 )
	return
else

If ( Wow == 1 )

	If ( Scared == 0 )
		AiFollow PLayer 0 0 0 0 0
		Set timer to ( timer + GetSecondsPassed )

		If ( timer > 20 )
			AiWander 0 0 0 0 0 0 0 0 0 0 0 0
			set timer to 0
			Return
		endif

	elseif ( Scared == 1)
		SetFlee 100
		StartCombat->Player
		Set timer to ( timer + GetSecondsPassed )

		If ( timer > 20 )
			StopCombat->Player
			set timer to 0
			Return
		endif
	endif

elseif ( Wow == 0 )

	If ( Scared == 1 )
		SetFlee 100
		StartCombat->Player
		Set timer to ( timer + GetSecondsPassed )

		If ( timer > 20 )
			StopCombat->Player
			set timer to 0
			Return
		endif
	endif

elseif	( Wow == 0 )

	If ( Scared == 0 )
		Return
	endif
endif

End